package com.shreecon.lms.common;

import com.shreecon.lms.interfaces.LMSException;

/**
 * The Class StringUtil.
 *
 * @author Santhosh
 */
public class StringUtil {

	/**
	 * Checks if is empty.
	 *
	 * @param value the value
	 * @return the boolean
	 */
	public static  Boolean isEmpty(String value){
		Boolean result = Boolean.FALSE;
		if(value != null ){
		   result = value.isEmpty();
		}
		return result;
	}
	
	/**
	 * Check for empty.
	 *
	 * @param value the value
	 * @param errorMessage the error message
	 * @throws LMSException the lMS exception
	 */
	public static void checkForEmpty( String value,String errorMessage)  throws LMSException {
		if( isEmpty(value)){
			throw new LMSException(errorMessage);
		}
	}
	
	/**
	 * The main method.
	 *
	 * @param args the arguments
	 * @throws Exception the exception
	 */
	public static void main(String[] args) throws Exception{
		checkForEmpty("", "dadadada");
	}
}
